home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / comms / other / amigancp_21 / docs / amigancp.doc next >
Text File  |  1999-11-29  |  60KB  |  1,913 lines

  1.  
  2.  
  3. AmigaNCP
  4. ********
  5.  
  6. Welcome to the AmigaNCP package, the AmigaOS implementation of
  7. Psion's NCP network protocol.
  8.  
  9. Copyright
  10. *********
  11.  
  12. The AmigaNCP package has been written by
  13.  
  14.      Oliver Wagner
  15.      Landsberge 5
  16.      D-45549 Sprockhövel
  17.      Germany
  18.      
  19.      email: owagner@vapor.com
  20.  
  21. The AmigaNCP driver library, the AmigaNCP File Server, the AmigaNCP
  22. File System, the AmigaNCP Documentation and all associated files are
  23. copyright (C) 1993-1999 Oliver Wagner, All Rights Reserved.
  24.  
  25.     Psion, the Psion Logo, Psion Series 33-LinkPsion HC,
  26. Psion MCSSD and Solid State Disk are registered Trademarks of
  27. Psion PLC.
  28.  
  29. The author wishes to thank the following people for their help during
  30. AmigaNCP development:
  31.  
  32. Frank "cyfm" Mariak
  33. Neil Bothwick
  34. Kenneth Jennings
  35. the members of the AmigaNCP Mailing List
  36.      For their help in implementing and debugging the EPOC32 protocol
  37.      part
  38.  
  39. David Wood of Psion Ltd.
  40.      Who provided the necessary information about the NCP protocol and
  41.      helped with beta testing the package
  42.  
  43. Jeremy "Jezar" Wakefield of Psion Ltd.
  44.      Who helped to track down several hidden and esoteric bugs.
  45.  
  46. Eric (ed@ramses.fdn.org)
  47.      For providing the original french catalog translation.
  48.  
  49. Phil Trickett (phil@dcs.king.ac.uk)
  50.      For the additional icon images.
  51.  
  52. Introduction
  53. ************
  54.  
  55. Overview
  56. ========
  57.  
  58. Psion's fine palmtop computer series, namely the S3 and S5, contain
  59. an even finer operating system, whose neat features cover a full
  60. fledged peer-to-peer networking software using a protocol called
  61. NCP.
  62.  
  63. Using NCP, you can link together two Psion computers or a Psion and a
  64. different, perhaps stationary machine and happily exchange data on your
  65. behalf.  NCP services include, but are not limited to, accessing files
  66. on the remote machines as if they were on yours, in both directions.
  67.  
  68. Linking your palmtop to your stationary machine is generally quite a
  69. good idea.  Doing so via the NCP protocol requires your stationary
  70. machine to have an implemention of this protocol.  There have only been
  71. implementations for MS-DOS clones (the MCLINK.EXE shell), for Apple
  72. MacIntosh and for Acorn Archimedes - until now.
  73.  
  74. AmigaNCP features a full NCP implementation including a remote file
  75. server to access Amiga files from your Psion and a file system to access
  76. Psion files from your Amiga.  The package also offers an API to allow
  77. custom applications to directly access network services at the NCP
  78. level.
  79.  
  80. Parts of AmigaNCP
  81. =================
  82.  
  83. AmigaNCP actually consists of several different programs.
  84.  
  85. The main part is the amigancp.library.  It contains the basic network
  86. services for exchanging data between two machines via a serial
  87. connection.  The protocol provides up to 8 data channels, which can be
  88. either passive (awaiting a connection from a client process) or active
  89. (attempting to connect to a server process).  One of the channels is
  90. reserved for the network supervisor application LINK.  The LINK
  91. functionality also has been integrated into amigancp.library.
  92.  
  93. Besides network I/O functions, the library also provides several
  94. utility functions to deal with Psion text format and the Intel byte
  95. ordering.
  96.  
  97. The AmigaNCP-FileSystem uses the amigancp.library to connect to
  98. the file server running on your Psion in order to provide access to
  99. Psion files from the AmigaDOS environment.  It provides a new AmigaDOS
  100. device named NCP: which offers access to all available Psion devices.
  101. The Psion devices will be mounted as subdirectories in the NCP:
  102. window.
  103.  
  104. The AmigaNCP-FileServer is an application built on top of
  105. amigancp.library.  It provides a means of accessing AmigaDOS
  106. files from the remote Psion computer via the REM:: file system.  This
  107. allows you to access Amiga files just as if they were local Psion
  108. files.  With the Psion S3a, it allows you to use the Backup option to
  109. backup vital data files on your Amiga's harddisk.
  110.  
  111. The AmigaNCP-Monitor monitors the activity of the NCP supervisor and
  112. gives detailed statistics about all channels.  This is an invaluable
  113. aid for debugging NCP applications.
  114.  
  115. The AmigaNCP-PrintServer allows you to print from your S3 or S5
  116. directly to a printer connected to the Amiga.
  117.  
  118. The S3Run program remotely launches programs or applications on your
  119. Psion.
  120.  
  121. Using AmigaNCP
  122. **************
  123.  
  124. Installation
  125. ============
  126.  
  127. For using AmigaNCP you'll need...
  128.  
  129.   1. any Amiga equipped with OS 2.04 or better and a free serial port
  130.  
  131.   2. the IBM-PC version of the 3-Link serial cable
  132.  
  133.   3. and a Psion S3, S3a, S3c or S5 (or any other model featuring
  134.      Remote Link)(1).
  135.  
  136.  
  137. To support Amiga systems without a hard disk, the AmigaNCP distribution
  138. has been organized to be ready-to-use.
  139.  
  140. Hard disk installation of AmigaNCP is best done using the provided
  141. Installer script.  The script will (by default) copy
  142. amigancp.library to LIBS:, put the language catalogs into
  143. LOCALE:Catalogs/ and create an AmigaNCP drawer on your work
  144. partition.  The drawer will contain the network services, documentation
  145. and the NCP tools.  There's an additional option for installing the
  146. amigancp.library developer material.
  147.  
  148. When installing the package for the first time, the installation
  149. procedure will ask you about the Psion model you're going to connect
  150. to.  The serial line speed will be set to the model's maximum (that is
  151. 9600 baud for the S3 or HC and 19200 baud for S3a or MC). You may
  152. change the serial parameters later on, though.
  153.  
  154. Configuring amigancp.library
  155. ============================
  156.  
  157. The default serial configuration is to use the serial.device, unit 0,
  158. at 9600 baud(2).
  159.  
  160. You can overwrite these default parameters by setting or changing the
  161. environment variable AmigaNCP.config.  The environment variable will
  162. be read by the amigancp.library each time a serial connection has to
  163. be established.
  164.  
  165. The parameter parsing is done just like in a shell command line; the
  166. template is D=DEVICE/K, U=UNIT/K/N, B=BAUD/K/N, NOREQ/S, SERIES5/S.
  167. All parameters are optional, those not given will retain their default
  168. values.
  169.  
  170. An example:  To make AmigaNCP use duart.device, unit 1 at 19200 baud
  171. you have to set ENV:AmigaNCP.config to
  172.  
  173.     DEVICE=duart.device UNIT=1 BAUD=19200
  174.  
  175. The installation script will create both ENV:AmigaNCP.config and
  176. ENVARC:AmigaNCP.config with either
  177.  
  178.     DEVICE=serial.device UNIT=0 BAUD=9600
  179.  
  180. or
  181.  
  182.     DEVICE=serial.device UNIT=0 BAUD=19200
  183.  
  184. depending on your choice of Psion model.  Please note, that you may
  185. actually use any baud rate supported by the serial port in question
  186. (and of course supported by the other side's serial interface as well).
  187.  
  188. If you set the NOREQ switch, the library will not display any error
  189. requesters.
  190.  
  191. Setting SERIES5 will enable the EPOC32 protocol support for the
  192. Series 5 models.
  193.  
  194. Note that you have to configure the remote site as well.  On the Psion
  195. S3 or S3a this consists of turning on NCP via the Remote Link menu of
  196. the system screen.  The baud rate must of course be set to the same
  197. value as used in ENV:NCP.config, or to 9600 if no configuration file
  198. exists.
  199.  
  200. Starting AmigaNCP
  201. =================
  202.  
  203. You don't start amigancp.library directly.  Instead you start one or
  204. more of the AmigaNCP applications, which in turn will open the library
  205. and try to establish their connections to the remote NCP site.
  206.  
  207. The library automatically terminates a connection about 10 seconds
  208. after the last application has closed its network channels.
  209.  
  210. Note that the underlying serial device is free to be used by any other
  211. application as long as no NCP connection is active and no connection
  212. attempt is made.
  213.  
  214. NCP Requesters
  215. ==============
  216.  
  217. The amigancp.library will put up error requesters if the network link
  218. breaks (and the NOREQ switch hasn't been set, see above).  The
  219. following table shows possible error conditions:
  220.  
  221. Can't open serial device
  222.      The device specified in ENV:AmigaNCP.config could not be opened.
  223.      Either the device does not exist (perhaps just because you
  224.      misspelled the device name) or it is in use by another process.
  225.  
  226. Timeout waiting for response
  227.      The serial device opened ok but the other side is not responding
  228.      to our handshake packet.  Most likey there is no Psion connected,
  229.      or it has it's Remote Link turned off.  This requester will
  230.      constantly show up if the AmigaNCP file system is running and the
  231.      serial link broke down.
  232.  
  233. Data not acknowledged
  234.      The last data packet has not been acknowledged.  This normally
  235.      denotes an NCP connection which has been interrupted during data
  236.      transfer.
  237.  
  238. Connection dropped
  239.      The remote side dropped the connection.
  240.  
  241. Argument error
  242.      Bad LLMAC request arguments.  You normally should not see this
  243.      error, it denotes an internal failure in the amigancp.library
  244.      high level I/O functions.
  245.  
  246. Not connected
  247.      There is no LLMAC connection.  You normally should not see this
  248.      error, it denotes an internal failure in the amigancp.library
  249.      high level I/O functions.
  250.  
  251. ---------- Footnotes ----------
  252.  
  253. (1)  In fact of course any NCP implementation does.  You can use
  254. AmigaNCP to connect to an NCP server running on an IBM PC or Apple Mac,
  255. or even to another AmigaNCP running on a different Amiga.
  256.  
  257. (2)  All other serial flags are fixed to 8N1, highspeed mode and 7-wire
  258. RTS/CTS handshake since this is required by the NCP protocol.
  259.  
  260. AmigaNCP File Server
  261. ********************
  262.  
  263. Introducing the File Server
  264. ===========================
  265.  
  266. The AmigaNCP File Server is an NCP application which provides access
  267. to Amiga files from the remote machine.  On startup it creates a
  268. passive NCP channel awaiting a connection from a remote file system.
  269.  
  270. Note tha the AmigaNCP File Server will not work with the Psion S5, as
  271. the network filesystem is not included in the S5 ROM.
  272.  
  273. On the S3 and S3a, the remote file system is built into the ROM.  It
  274. automatically attempts to connect to the remote file server when an NCP
  275. connection is made, and presents a new filesystem node named REM::,
  276. which in turn contains all the Amiga devices.  You can navigate through
  277. the Amiga devices via the system screen or directly access a file by
  278. it's full path name.
  279.  
  280. The Psion's file system was designed to be device independant, so there
  281. are no restrictions concerning the length of file names or extensions:
  282. The complete Amiga device, directory and file names are fully
  283. preserved.  However, directories are separated in the standard Psion
  284. manner via the \ character.
  285.  
  286. An example:  To access the Amiga file HD1:Test/Test.txt from the
  287. Psion, use the file name REM::HD1:\TEST\TEST.TXT.  To access
  288. SYS:S/Startup-Sequence, use REM::\SYS:\STARTUP-SEQUENCE.
  289.  
  290. When asked for a device list, the AmigaNCP File Server will output only
  291. real file system devices(1).  However, you may in fact access any
  292. AmigaDOS device, even volumes and assigned names, from the remote site
  293. by using the direct path to it.
  294.  
  295. An example:  To access the Amiga's parallel port from the remote site,
  296. just use the path REM::PAR:\.  This is quite useful for using the
  297. print-to-file capabilities of some of the Psion applications.
  298.  
  299. Character conversion mode
  300. =========================
  301.  
  302. Since the Psion's operating system uses a different character codeset
  303. than the Amiga does, you normally can't easily exchange ASCII files
  304. between the two machines.  The AmigaNCP File Server however provides a
  305. special conversion mode which allows to convert files on the fly.
  306.  
  307. Whenever you add the special extension .CV to any remote file name,
  308. all characters read from or written to that file will
  309. automatically be converted by AmigaNCP.  The conversion is fully
  310. transparent to your applications.
  311.  
  312. An example:  To edit the Amiga text file HD1:Test/Test.TXT on the S3
  313. with automatic character conversion, use the virtual file name
  314. REM::HD1:\TEST\TEST.TXT.CV.
  315.  
  316. Note that character conversion mode should be used only for text
  317. files.  The S3 and S3a Word file format for example contains binary
  318. data which will be gracefully mangled if accessed in conversion mode.
  319.  
  320. File Server Options
  321. ===================
  322.  
  323. The AmigaNCP File Server may be started either from the shell or from
  324. Workbench.  To terminate the server, just start it again, it will put
  325. up a requester showing you the number of files in use and asking you
  326. whether you really want to quit.
  327.  
  328. The File Server accepts several options to modify the way it operates.
  329. Note that you have to set up amigancp.library first (See Using
  330. AmigaNCP.).
  331.  
  332. Options may be given on the command line (shell) or using tooltype
  333. entries (Workbench).  You may use project icons to start the File
  334. Server in order to have different configurations at hand.
  335.  
  336. The option template is:
  337.          IBM=CHARSETCONV/S,
  338.      SHOWICONS=SHOWINFO/S,
  339.      HIDEEMPTYDRIVES/S,
  340.      BUFFER=BUFFERSIZE
  341. You may enter ? to get additional help at the command line.  Detailed
  342. parameter descriptions follow.
  343.  
  344. CharSetConv
  345. -----------
  346.  
  347. When the remote file system requests a directory scan, the file server
  348. examines each file to determine whether it is a text file or not(2).
  349. Text files are then returned both with their normal name and with the
  350. magic extension .CV added.
  351.  
  352. ShowInfo
  353. --------
  354.  
  355. Show *.info and .backdrop files during a directory scan.  You
  356. normally shouldn't set this option, the Psion has no use for these
  357. files and directory scans are much faster without them.
  358.  
  359. Please note that the Psion's Delete Whole Directory function will
  360. only work correctly on Amiga directories if ShowInfo has been enabled.
  361.  
  362. HideEmptyDrives
  363. ---------------
  364.  
  365. Upon a device list query, don't return drives which currently do not
  366. contain a medium.  This option is intended mainly to overcome an
  367. annoying quirk in the S3 and S3a system screen which resets the current
  368. device to LOC::\M\ each time a device reports E_NOT_READY.  This
  369. normally always happens when getting to REM::DF0: with no disk in the
  370. drive.
  371.  
  372. Note that, although these devices are not visible in the device list,
  373. they may as usual be accessed by manually entering the device name.
  374.  
  375. BufferSize
  376. ----------
  377.  
  378. Set the size of the filehandle buffers used by the File Server.  This
  379. parameter defaults to 4096 Bytes and normally doesn't need to be
  380. changed(3).
  381.  
  382. ---------- Footnotes ----------
  383.  
  384. (1)  Tech info:  Any device which responds positively to
  385. ACTION_IS_FILESYSTEM is considered to be a real file system.
  386.  
  387. (2)  Tech info:  This is done by reading the first 512 Bytes and
  388. scanning them for non-printable characters.  Files with the S
  389. protection bit set are always assumed to be text files.
  390.  
  391. (3)  This option has no effect on AmigaOS below version 3.1
  392.  
  393. AmigaNCP File System
  394. ********************
  395.  
  396. Introducing the File System
  397. ===========================
  398.  
  399. The AmigaNCP File System is an NCP application which provides access
  400. from the AmigaDOS environment to files on the remote machine.  It
  401. creates a new AmigaDOS device named NCP:, which in turn contains all
  402. remote devices as subdirectories.
  403.  
  404. The Amiga directory NCP:A refers to the device A: on the remote
  405. side, NCP:M refers to M: and so on.
  406.  
  407. If you want to access any file on the remote device, just add the full
  408. path name.  To access the file A:\WRD\SECRET.WRD, just use the Amiga
  409. file name NCP:A/WRD/SECRET.WRD.
  410.  
  411. You can access the new device from any Amiga application, including
  412. Workbench and your favourite directory tool, as if they were standard
  413. Amiga files.
  414.  
  415. On startup, the AmigaNCP File System immediately attempts to connect to
  416. the File Server on the remote machine.  If no connection can be made,
  417. the File System will refuse to start.  You may attempt to quit it at
  418. any time by starting it again, however, due to AmigaDOS constraints it
  419. will refuse to quit if there are any files or locks still in use.
  420.  
  421. Character Conversion Mode
  422. =========================
  423.  
  424. The AmigaNCP File System also features the character conversion mode.
  425. If you enable this option, all remote devices will be mirrored as
  426. CONV_<devname>, and all characters read from or written to files
  427. within these subdirectories will automatically be converted.
  428.  
  429. Example:  To access A:\WRD\SECRET.TXT with character conversion, use
  430. the file name NCP:CONV_A/WRD/SECRET.TXT.
  431.  
  432. The translation is fully transparent; you may, for example, use your
  433. favourite text editor to load a text file from the Psion, edit it and
  434. save it again.  Upon reading, it will be converted to the Amiga ISO
  435. character set, upon writing, it will be converted back to the IBM codes
  436. used by the Psion.
  437.  
  438. File System Options
  439. ===================
  440.  
  441. The File System accepts several options to modify the way it operates.
  442. Note that you have to set up amigancp.library first (See Using
  443. AmigaNCP.).
  444.  
  445. Upon shell startup, options are specified on the command line.  The
  446. template is:
  447.          VOL=VOLUMENAME/K,
  448.      DEV=DEVICENAME/K,
  449.      SR=SHAREDREAD/S,
  450.      IBM=CHARSETCONV/S,
  451.      HED=HIDEEMPTYDRIVES/S,
  452.      DWMS=DONTWARNMISSINGSERVER/S,
  453.      ARR=AUTOREREAD/S,
  454.      ID=ICONDIR/S,
  455.      PsionToAmigaClip=PTAC/K
  456. You may enter ? to get additional help at the command line.  See
  457. below for detailed descriptions of these parameters.
  458.  
  459. If started from Workbench, the File System application will read its
  460. icon and parse the tooltypes for the same option keywords.  You may use
  461. project icons for starting the File System in order to have different
  462. configurations at hand.
  463.  
  464. VolumeName
  465. ----------
  466.  
  467. This options allows you to set the volume node name of the File System.
  468. Defaults to AmigaNCP-Remote.  This is the name the Workbench shows
  469. below the disk icon.
  470.  
  471. DeviceName
  472. ----------
  473.  
  474. Modifies the device name of the File System.  Defaults to NCP:.
  475.  
  476. SharedRead
  477. ----------
  478.  
  479. For historical reasons, there is no real read only mode in the
  480. AmigaDOS.  The access mode MODE_OLDFILE can be used for reading and
  481. writing an existing file from multiple accessors.  So an Amiga file
  482. system cannot predict whether a file opened with MODE_OLDFILE will
  483. also be written to.
  484.  
  485. The Psion filing system however limits multiple file access to read
  486. only mode.
  487.  
  488. To be as compatible as possible with existing Amiga applications, the
  489. AmigaNCP File System by default translates MODE_OLDFILE to exclusive
  490. read/write access on the Psion.
  491.  
  492. This may cause problems if a file is already opened for reading from
  493. the Psion side, perhaps because you have a Psion application running
  494. which accesses this file.  Even a read only access from the Amiga side
  495. will fail because it translates to a read/write access on the Psion
  496. side.
  497.  
  498. In order to overcome this AmigaDOS quirk, the AmigaNCP File System
  499. provides this option to translate MODE_OLDFILE to a shared read
  500. access on the Psion side.  Every write attempt on such a file will
  501. result in a ERROR_WRITE_PROTECTED.
  502.  
  503. CharSetConv
  504. -----------
  505.  
  506. Activate character conversion mode.  All Psion devices are mirrored as
  507. CONV_<devname and read/write accesses to files within these drawers
  508. are silently translated.
  509.  
  510. Note that file handles opened in character conversion mode don't
  511. support ACTION_SEEK.  This may cause problems with some applications.
  512.  
  513. HideEmptyDrives
  514. ---------------
  515.  
  516. Don't create subdirectories for Psion devices which don't contain a
  517. medium.
  518.  
  519. DontWarnMissingServer
  520. ---------------------
  521.  
  522. The File Server should normally be started first, because the Psion
  523. LINK application attempts to contact it as soon as the connection has
  524. been established, and it will not try again if no connection could be
  525. made.
  526.  
  527. Therefore, the File System will warn you with a requester if it can't
  528. detect the AmigaNCP File Server when it is started.  Setting this option
  529. instructs the File System not to do so.
  530.  
  531. This option is ignored in SERIES5 mode.
  532.  
  533. AutoReRead
  534. ----------
  535.  
  536. By default, the File System reads the remote device list only once at
  537. the time it is started.
  538.  
  539. This should normally be no problem, unless you use HideEmptyDrives
  540. and replace SSD cartridges while a connection is active.
  541.  
  542. You can use DiskChange NCP: at any time to manually force the File
  543. System to read the device list again.  Or you can set AutoReRead,
  544. which causes the File System to read the device list from the remote
  545. side upon every access, which of course will slow accesses down a bit.
  546.  
  547. IconDir
  548. -------
  549.  
  550. In order to be compatible with the Workbench environment, the File
  551. System stores icon and workbench information files (.info and
  552. .backdrop) in a special file hierarchy on the AmigaDOS side.
  553. This allows you to do snapshoting and backdroping of icons belonging to
  554. Psion files without wasting valuable storage memory on the Psion.  This
  555. also avoids the problem that the Psion file system can't handle file
  556. extensions longer than three characters.
  557.  
  558. The default path for storing these files is the drawer Icons in the
  559. subdirectory where the File System program resides.  Using the
  560. IconDir option, you can specify another path.  This is quite
  561. useful if you use AmigaNCP to connect to different Psions with
  562. different file structures.
  563.  
  564. The file structure inside this IconDir drawer is organized exactly like
  565. in the NCP: device.  So, a icon file belonging to WRD drawer on the
  566. M device on the Psion is located in Icons/M/WRD.info.
  567.  
  568. PsionToAmigaClip
  569. ----------------
  570.  
  571. Hotkey specification (like any other Commoditiy).
  572.  
  573. Pressing the hotkey will read the Psion clipboard data file
  574. NCP:C/System/Data/Clpboard.cbd into the Amiga clipboard in FTXT
  575. format. Will convert newlines and do iso/ibm conversion.
  576.  
  577. Implementation Details
  578. ======================
  579.  
  580. The AmigaNCP File System supports the following AmigaDOS packet types:
  581.  
  582.    * ACTION_IS_FILESYSTEM
  583.  
  584.    * ACTION_FLUSH
  585.  
  586.    * ACTION_DISK_INFO
  587.      The resulting disk sizes are calculated by adding the per-device
  588.      sizes of the underlying Psion devices.
  589.  
  590.    * ACTION_INFO
  591.  
  592.    * ACTION_COPY_DIR
  593.  
  594.    * ACTION_COPY_DIR_FH
  595.  
  596.    * ACTION_LOCATE_OBJECT
  597.  
  598.    * ACTION_FREE_LOCK
  599.  
  600.    * ACTION_EXAMINE_FH
  601.  
  602.    * ACTION_EXAMINE_OBJECT
  603.  
  604.    * ACTION_EXAMINE_NEXT
  605.      Psion directory lists are read completly on the first EXNEXT
  606.      packet and kept in a private cache of the lock. This results in a
  607.      ExAll() like performance even with using the old style directory
  608.      scanning packets.
  609.  
  610.    * ACTION_CURRENT_VOLUME
  611.  
  612.    * ACTION_SAME_LOCK
  613.  
  614.    * ACTION_CREATE_DIR
  615.  
  616.    * ACTION_PARENT
  617.  
  618.    * ACTION_PARENT_FH
  619.  
  620.    * ACTION_DELETE_OBJECT
  621.  
  622.    * ACTION_RENAME_OBJECT
  623.      Note that renaming an non-icon file to an icon-file will yield
  624.      ERROR_RENAME_ACROSS_DEVICES.
  625.  
  626.    * ACTION_DIE
  627.  
  628.    * ACTION_FINDINPUT
  629.      See the description of the SharedRead option for differen
  630.      translation modes.
  631.  
  632.    * ACTION_FINDOUTPUT
  633.  
  634.    * ACTION_FINDUPDATE
  635.      This always translates to exclusive access on the Psion side.
  636.  
  637.    * ACTION_INHIBIT
  638.  
  639.    * ACTION_END
  640.  
  641.    * ACTION_READ
  642.  
  643.    * ACTION_WRITE
  644.  
  645.    * ACTION_SEEK
  646.      Not available on files opened in character conversion mode.
  647.  
  648.    * ACTION_SET_PROTECT
  649.      Supports FIBF__ARCHIVEFIBF_READFIBF_WRITE  and
  650.      FIBF_EXECUTE.
  651.  
  652.    * ACTION_SET_DATE
  653.  
  654. Other Tools
  655. ***********
  656.  
  657. The AmigaNCP package contains a few more programs which are meant for
  658. the advanced user.  Since they are also good examples for how to access
  659. the amigancp.library, the source code for most of these utilities can
  660. be found in the Developer/Source/ drawer.
  661.  
  662. AmigaNCP-Monitor
  663. ================
  664.  
  665. The AmigaNCP-Monitor is a utility for monitoring the current network
  666. activity.  It displays an overview over the eight avaible NCP channels,
  667. their users, current connection states and the amount of data that has
  668. been transferred.
  669.  
  670.     AmigaNCP-Monitor may be started either from the shell or from
  671. Workbench.  There are no additional parameters.  The window position
  672. will be saved as a tooltype entry.
  673.  
  674. The Monitor opens a single window on the workbench screen.  The top
  675. part displays the states of the eight network channels, the bottom part
  676. shows overall statistics and whether NCP is currently connected.
  677.  
  678. ThisProc
  679.      The network name of the Amiga process using the channel.  The
  680.      first channel is always allocated by the LINK application.
  681.  
  682. RemotePr
  683.      The name of the remote process.  This may be empty, meaning the
  684.      channel is currently not connected.
  685.  
  686.          UnknClnt identifies a passive channel connected to an
  687.      unknown client.
  688.  
  689.      For the first channel, this may be either ARemLink, denoting
  690.      that the current connection has been initiated by the remote link,
  691.      or PRemLink, if the current connection was opened on behalf of
  692.      the amigancp.library.
  693.  
  694. Status
  695.      This flag array denotes various internal states of
  696.      amigancp.library.
  697.  
  698. Bytes Sent
  699.      How many bytes have been sent through this channel?
  700.  
  701. Bytes Received
  702.      How many bytes have been received through this channel?
  703.  
  704. Online since
  705.      The time on which amigancp.library was started first.  The
  706.      startup time is used by the NCP protocol to determine whether a
  707.      broken connection can be reestablished or not.
  708.  
  709. Remote NCP
  710.      The remote NCP's startup time.
  711.  
  712. Version
  713.      The remote NCP's version.  This is generally 2 for AmigaNCP and
  714.      the Psion S3 and 3 for the S3a.
  715.  
  716. Connected
  717.      This will be displayed whenever there is an active connection to
  718.      any remote NCP.
  719.  
  720. AmigaNCP-PrintServer
  721. ====================
  722.  
  723. The AmigaNCP-PrintServer is a small utility which allows you to print
  724. from your Psion directly to a printer connected to the Amiga.  It uses
  725. the Psion's capability to print to a serial printer, and simply passes
  726. any data from the serial port directly to the printer device via raw
  727. writes.
  728.  
  729. You have to turn off the Remote Link on the Psion side and terminate
  730. any NCP application running on the Amiga side before starting the
  731. AmigaNCP-PrintServer.  If you forget to turn off the Remote Link, junk
  732. will be printed due to misinterpreted NCP packets!
  733.  
  734. You must also set your Psion's printer configuration to serial
  735. printing, with the same baud rate used for NCP connections, turn off
  736. Xon/Xoff and turn on RTS/CTS and DSR/DTR handshaking.  The
  737. AmigaNCP-PrintServer itself reads the serial configuration from the
  738. file ENV:NCP.config.
  739.  
  740. The AmigaNCP-PrintServer uses the raw write capabilities of the
  741. printer.device and therefore ignores any printer driver settings.
  742. However, it respects your choice on which device to print, and even
  743. allows printing via network printer services, e.g.  Envoy Network
  744. Printing.
  745.  
  746. Therefore, you must select the correct WDR printer driver on the
  747. Psion.  This can be done in the Printer Setup dialog of the
  748. Word application.
  749.  
  750. Having done all this, you can print from your Psion applications simply
  751. by selecting the Print... menu, just as if the printer was connected
  752. directly to the Psion.
  753.  
  754. S3Run
  755. =====
  756.  
  757. The S3Run utility uses the LINK application's capability to launch
  758. a process on the remote side.  It's a shell only program which takes
  759. one or two parameters: S3Run filename commandline
  760.  
  761. The first argument denotes the file name of the remote program to run,
  762. for example TEST.IMG.  Due to NCP restrictions, this may only be a
  763. program on the Psion's top level directory or ROM.
  764.  
  765. The second argument may contain the command line to be passed to the
  766. created process.  This argument may be omitted, in which case no command
  767. line will be passed.
  768.  
  769. You may use \xx escaping to insert the hexadecimal code xx into
  770. the command line.  See `the Psion SIBO SDK Manual' for more information
  771. on S3 command lines.
  772.  
  773. API
  774. ***
  775.  
  776. This part of the AmigaNCP documentation describes the use of AmigaNCP
  777. services within custom applications.  It assumes a broad knowledge of
  778. programming AmigaOS.
  779.  
  780. NCP Implementation
  781. ==================
  782.  
  783. The Psion NCP network protocol consists of four layers:
  784.  
  785. Serial Layer
  786.      A simple asynchronous serial 8/N/1 connection.  This is in fact
  787.      the hardware serial connection built into the 3-Link.
  788.  
  789. Packet Layer
  790.      A packet protocol providing checksums and multiple
  791.      retransmissions.  It is called LLMAC and somewhat based on the
  792.      MNP type protocols.
  793.  
  794. NCP Layer
  795.      NCP provides up to eight independant data streams between local
  796.      and remote processes.  Under the Psion OS, a process may use only
  797.      one NCP channel at a time.
  798.  
  799. Application Layer
  800.      Applications built on top of the NCP data stream service.  This
  801.      includes the remote file system and remote file server.  There is
  802.      also a supervisory application called LINK which controls the
  803.      server setup.
  804.  
  805. A more detailed description of NCP usage from the Psion side can be
  806. found in the `Psion SIBO SDK Manual, I/O Devices Reference'.
  807.  
  808. On the Amiga side, the serial layer is provided through any standard
  809. EXEC serial device, normally this will be the internal port's
  810. serial.device.  The packet and NCP layers have been built into
  811. the amigancp.library.
  812.  
  813. Besides these basic layers, also the supervisory LINK application
  814. resides in the
  815.     amigancp.library.
  816.  
  817. All network services are accessible via function calls to the
  818. amigancp.library.  In order to use these functions, you have to
  819. open the amigancp.library first:
  820.  
  821.          #include <libraries/ncp.h>
  822.      
  823.          struct Library *NCPBase;
  824.          NCPBase = OpenLibrary( "amigancp.library", NCP_VERSION );
  825.          if( !NCPBase )
  826.              fail_app();
  827.  
  828. If you use SAS/C 6.50 or above, you may want to use the link library
  829. ncp.lib provided in the development toolkit.  It contains a
  830. constructor/destructor pair that automatically opens/closes the
  831. amigancp.library upon startup/termination of your application.
  832.  
  833. If you are not using C, you'll have to build your own language specific
  834. glue definitions.  A function description file
  835. (Developer/FD/ncp_lib.fd) has been included.  The AmigaNCP
  836. programming interface doesn't use any fancy data structures, so you
  837. should have no problems with other programming languages.
  838.  
  839. The NCP network services are based on channels.  A channel is a
  840. connection between a local and a remote processes.  In the Psion EPOC
  841. environment, a channel is bound to a single process and bears the name
  842. of that process.  AmigaNCP allows you to specify arbitrary names for
  843. your channels, along with having multiple channels within a single
  844. application, if you wish to do so.
  845.  
  846. A channel may be opened in either active or passive mode.  An
  847. active channel attempts to connect to a remote process with a given name
  848. and refuses to open if the remote process doesn't exists or already is
  849. busy with some other connection.  A passive channel just sits around
  850. awaiting a connection from the remote site.  Passive channels are
  851. normally used for server applications awaiting connections from their
  852. clients, whereas active channels are used by clients to contact their
  853. server application.
  854.  
  855. I/O via NCP is done either synchronously or asynchronously.  The
  856. I/O interface of the amigancp.library is quite similar to the EXEC
  857. device I/O interface.  See the function descriptions of the NCP I/O
  858. functions for more details.
  859.  
  860. The Developer/Source/ drawer provides some examples to show the use
  861. of the
  862.     amigancp.library calls.
  863.  
  864. Function Reference
  865. ==================
  866.  
  867. Note that this function reference is also available in standard Amiga
  868. Autodoc format (Developer/Autodocs/ncp.doc).
  869.  
  870. The amigancp.library also contains a clone set of the exec.library
  871. memory pool functions which do work with AmigaOS 2.x systems. The the
  872. exec.library documentation for more information about these functions.
  873.  
  874. NCP_CloseChannel
  875. ----------------
  876.  
  877.         NAME
  878.          NCP_CloseChannel -- close an NCP channel
  879.      
  880.         SYNOPSIS
  881.          NCP_CloseChannel( channel )
  882.                             A0
  883.      
  884.         void NCP_CloseChannel( APTR );
  885.      
  886.         FUNCTION
  887.          Close a NCP channel previously opened by NCP_OpenChannel().
  888.          If this is an active link to the remote machine, it will be
  889.          closed.
  890.      
  891.         INPUTS
  892.          channel -- channel to close. May be NULL, in which case
  893.                     this functions does nothing.
  894.      
  895.         RESULT
  896.          None.
  897.      
  898.         EXAMPLE
  899.      
  900.         NOTES
  901.          An active NCP connection will be dropped about 10s
  902.          after the last channel has been closed.
  903.      
  904.         BUGS
  905.          None known.
  906.      
  907.         SEE ALSO
  908.          NCP_OpenChannel()
  909.  
  910. NCP_OpenChannel
  911. ---------------
  912.  
  913.         NAME
  914.          NCP_OpenChannel -- open an NCP channel to attempt to connect to
  915.                            the remote.
  916.      
  917.         SYNOPSIS
  918.          channel = NCP_OpenChannel( localname, remotename, flags )
  919.            D0                          A0          A1        D0
  920.      
  921.          APTR NCP_OpenChannel( STRPTR, STRPTR, ULONG );
  922.      
  923.         FUNCTION
  924.          Opens an NCP channel. If remotename is not NULL, attempts
  925.          to connect to the remote process and fails with a NULL
  926.          return if the connection could not be made. If remotename
  927.          is NULL, creates a passive channel silently awaiting remote
  928.          connection.
  929.      
  930.         INPUTS
  931.          localname -- name of local "process"
  932.          remotename -- either NULL for a passive channel or
  933.                        the remote process name which to connect
  934.                        to
  935.          flags -- currently unused, leave at 0
  936.      
  937.         RESULT
  938.          channel -- pointer to a channel object. NULL in case of
  939.                     an error, whereas additional error information
  940.                     can be found in IoErr()
  941.      
  942.         EXAMPLE
  943.          To connect to the remote file server:
  944.      
  945.             APTR channel;
  946.             channel = NCP_OpenChannel( "TestHost", "SYS$RFSV.*", 0 );
  947.      
  948.      
  949.         NOTES
  950.          Opening an active channel will result in an attempt to
  951.          create an NCP connection and fail upon any error (including
  952.          serial failure or inexistance of the remote process).
  953.          Creating an passive channel will not cause an NCP connection
  954.          attempt; this is done upon the first I/O request made to
  955.          channel.
  956.      
  957.         BUGS
  958.          None known.
  959.      
  960.         SEE ALSO
  961.          NCP_CloseChannel()
  962.  
  963. NCP_Read
  964. --------
  965.  
  966.         NAME
  967.          NCP_Read -- do a read request.
  968.      
  969.         SYNOPSIS
  970.          status = NCP_Read( channel, data, datasize )
  971.            D0                     A0
  972.      
  973.          LONG NCP_Read( APTR, APTR, ULONG );
  974.      
  975.         FUNCTION
  976.          This is basically identical to calling NCP_BeginRead()
  977.          followed by NCP_WaitRead().
  978.      
  979.         INPUTS
  980.          channel -- a NCP channel created by NCP_OpenChannel()
  981.          data -- receive buffer
  982.          datasize -- receive buffer size
  983.      
  984.         RESULT
  985.          status -- number of bytes read or a negative error
  986.                    number.
  987.      
  988.         EXAMPLE
  989.      
  990.         NOTES
  991.      
  992.         BUGS
  993.      
  994.         SEE ALSO
  995.          NCP_WaitRead(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  996.  
  997. NCP_BeginRead
  998. -------------
  999.  
  1000.         NAME
  1001.          NCP_BeginRead -- start a read request on the NCP channel.
  1002.      
  1003.         SYNOPSIS
  1004.          error = NCP_BeginRead( channel, data, datasize )
  1005.            D0                     A0      A1       D0
  1006.      
  1007.          LONG NCP_BeginRead( APTR, APTR, ULON G);
  1008.      
  1009.         FUNCTION
  1010.          Queues a read operation on the current NCP channel.
  1011.      
  1012.         INPUTS
  1013.          channel -- a NCP channel created by NCP_OpenChannel()
  1014.          data -- receive buffer
  1015.          datasize -- receive buffer size
  1016.      
  1017.         RESULT
  1018.          error -- either 0 if the read was queued successfully
  1019.                   or a negative error number
  1020.      
  1021.         EXAMPLE
  1022.      
  1023.         NOTES
  1024.          Only one read request may be queued at a time on a single
  1025.          channel. This function fails with NCPE_INUSE if there is
  1026.          already a read request outstanding.
  1027.      
  1028.         BUGS
  1029.          None known.
  1030.      
  1031.         SEE ALSO
  1032.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_CheckRead()
  1033.  
  1034. NCP_AbortRead
  1035. -------------
  1036.  
  1037.         NAME
  1038.          NCP_AbortRead -- abort read currently in progress
  1039.      
  1040.         SYNOPSIS
  1041.          NCP_AbortRead( channel )
  1042.                           A0
  1043.      
  1044.          void NCP_AbortRead( APTR )
  1045.      
  1046.         FUNCTION
  1047.          Aborts the current read request on the given NCP channel.
  1048.          Does nothing if no read is pending.
  1049.      
  1050.         INPUTS
  1051.          channel -- a NCP channel created by NCP_OpenChannel()
  1052.      
  1053.         RESULT
  1054.          None.
  1055.      
  1056.         EXAMPLE
  1057.      
  1058.         NOTES
  1059.          Never forget to finish a read request using NCP_WaitRead(),
  1060.          or you'll end up in OS hell.
  1061.      
  1062.         BUGS
  1063.          None known.
  1064.      
  1065.         SEE ALSO
  1066.          NCP_Read(), NCP_WaitRead(), NCP_CheckRead(), NCP_BeginRead()
  1067.  
  1068. NCP_CheckRead
  1069. -------------
  1070.  
  1071.         NAME
  1072.          NCP_CheckRead -- check if a read request is still pending
  1073.      
  1074.         SYNOPSIS
  1075.          status = NCP_CheckRead( channel )
  1076.            D0                       A0
  1077.      
  1078.          LONG NCP_CheckRead( APTR )
  1079.      
  1080.         FUNCTION
  1081.          Check if a read request is still pending on the given NCP
  1082.          channel.
  1083.      
  1084.         INPUTS
  1085.          channel -- a NCP channel created by NCP_OpenChannel()
  1086.      
  1087.         RESULT
  1088.          status -- FALSE if a read is currently pending,
  1089.                    TRUE if no request is pending or the current
  1090.                    request has completed.
  1091.      
  1092.         EXAMPLE
  1093.      
  1094.         NOTES
  1095.          Never forget to finish a read request using NCP_WaitRead(),
  1096.          or you'll end up in OS hell.
  1097.      
  1098.         BUGS
  1099.          None known.
  1100.      
  1101.         SEE ALSO
  1102.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_BeginRead()
  1103.  
  1104. NCP_WaitRead
  1105. ------------
  1106.  
  1107.         NAME
  1108.          NCP_WaitRead -- complete a read request on the NCP channel.
  1109.      
  1110.         SYNOPSIS
  1111.          result = NCP_WaitRead( channel )
  1112.            D0                     A0
  1113.      
  1114.          LONG NCP_WaitRead( APTR );
  1115.      
  1116.         FUNCTION
  1117.          Waits for the current read request to finish and
  1118.          returns the result.
  1119.      
  1120.         INPUTS
  1121.          channel -- a NCP channel created by NCP_OpenChannel()
  1122.      
  1123.         RESULT
  1124.          status -- number of bytes read or a negative error
  1125.                    number.
  1126.      
  1127.         EXAMPLE
  1128.      
  1129.         NOTES
  1130.          Every read request startet with NCP_BeginRead() absolutely
  1131.          must be followed by a NCP_WaitRead(), even if it already
  1132.          finished or was aborted via NCP_AbortRead().
  1133.      
  1134.         BUGS
  1135.          Calling this function without an queued read request
  1136.          will hang up your process.
  1137.      
  1138.         SEE ALSO
  1139.          NCP_Read(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  1140.  
  1141. NCP_ReadSig
  1142. -----------
  1143.  
  1144.         NAME
  1145.          NCP_ReadSig -- return signal mask of channel read port.
  1146.      
  1147.         SYNOPSIS
  1148.          sigmask = NCP_ReadSig( channel )
  1149.            D0                     A0
  1150.      
  1151.          ULONG NCP_ReadSig( APTR );
  1152.      
  1153.         FUNCTION
  1154.          This function returns the signal mask of the read port
  1155.          of the given NCP channel. This signal is set if a read
  1156.          request completes.
  1157.      
  1158.         INPUTS
  1159.          channel -- a NCP channel created by NCP_OpenChannel()
  1160.      
  1161.         RESULT
  1162.          sigmask -- signal mask of read port.
  1163.      
  1164.         EXAMPLE
  1165.      
  1166.         NOTES
  1167.          Note that this function returns a signal mask, not a signal bit number.
  1168.      
  1169.         BUGS
  1170.      
  1171.         SEE ALSO
  1172.          NCP_BeginRead()
  1173.  
  1174. NCP_Write
  1175. ---------
  1176.  
  1177.         NAME
  1178.          NCP_Write -- do a write request.
  1179.      
  1180.         SYNOPSIS
  1181.          status = NCP_Write( channel, data, datasize )
  1182.            D0                   A0     A1      D0
  1183.      
  1184.          LONG NCP_Write( APTR, APTR, ULONG );
  1185.      
  1186.         FUNCTION
  1187.          This is basically identical to calling NCP_BeginWrite()
  1188.          followed by NCP_WaitWrite().
  1189.      
  1190.         INPUTS
  1191.          channel -- a NCP channel created by NCP_OpenChannel()
  1192.          data -- receive buffer
  1193.          datasize -- receive buffer size
  1194.      
  1195.         RESULT
  1196.          status -- number of bytes written or a negative error
  1197.                    number.
  1198.      
  1199.         EXAMPLE
  1200.      
  1201.         NOTES
  1202.      
  1203.         BUGS
  1204.      
  1205.         SEE ALSO
  1206.          NCP_WaitWrite(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1207.  
  1208. NCP_BeginWrite
  1209. --------------
  1210.  
  1211.         NAME
  1212.          NCP_BeginWrite -- start a write request on the NCP channel.
  1213.      
  1214.         SYNOPSIS
  1215.          error = NCP_BeginWrite( channel, data, datasize )
  1216.            D0                     A0      A1       D0
  1217.      
  1218.          LONG NCP_BeginWrite( APTR, APTR, ULON G);
  1219.      
  1220.         FUNCTION
  1221.          Queues a write operation on the current NCP channel.
  1222.      
  1223.         INPUTS
  1224.          channel -- a NCP channel created by NCP_OpenChannel()
  1225.          data -- data buffer
  1226.          datasize -- data buffer size
  1227.      
  1228.         RESULT
  1229.          error -- either 0 if the write was queued successfully
  1230.                   or a negative error number
  1231.      
  1232.         EXAMPLE
  1233.      
  1234.         NOTES
  1235.          Only one write request may be queued at a time on a single
  1236.          channel. This function fails with NCPE_INUSE if there is
  1237.          already a write request outstanding.
  1238.      
  1239.         BUGS
  1240.          None known.
  1241.      
  1242.         SEE ALSO
  1243.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1244.  
  1245. NCP_AbortWrite
  1246. --------------
  1247.  
  1248.         NAME
  1249.          NCP_AbortWrite -- abort write currently in progress
  1250.      
  1251.         SYNOPSIS
  1252.          NCP_AbortWrite( channel )
  1253.                           A0
  1254.      
  1255.          void NCP_AbortWrite( APTR )
  1256.      
  1257.         FUNCTION
  1258.          Aborts the current write request on the given NCP channel.
  1259.          Does nothing if no write is pending.
  1260.      
  1261.         INPUTS
  1262.          channel -- a NCP channel created by NCP_OpenChannel()
  1263.      
  1264.         RESULT
  1265.          None.
  1266.      
  1267.         EXAMPLE
  1268.      
  1269.         NOTES
  1270.          Never forget to finish a write request using NCP_WaitWrite(),
  1271.          or you'll end up in OS hell.
  1272.      
  1273.         BUGS
  1274.          None known.
  1275.      
  1276.         SEE ALSO
  1277.          NCP_Write(), NCP_WaitWrite(), NCP_CheckWrite(), NCP_BeginWrite()
  1278.  
  1279. NCP_CheckWrite
  1280. --------------
  1281.  
  1282.         NAME
  1283.          NCP_CheckWrite -- check if a write request is still pending
  1284.      
  1285.         SYNOPSIS
  1286.          status = NCP_CheckWrite( channel )
  1287.            D0                       A0
  1288.      
  1289.          LONG NCP_CheckWrite( APTR )
  1290.      
  1291.         FUNCTION
  1292.          Check if a write request is still pending on the given NCP
  1293.          channel.
  1294.      
  1295.         INPUTS
  1296.          channel -- a NCP channel created by NCP_OpenChannel()
  1297.      
  1298.         RESULT
  1299.          status -- FALSE if a write is currently pending,
  1300.                    TRUE if no request is pending or the current
  1301.                    request has completed.
  1302.      
  1303.         EXAMPLE
  1304.      
  1305.         NOTES
  1306.          Never forget to finish a write request using NCP_WaitWrite(),
  1307.          or you'll end up in OS hell.
  1308.      
  1309.         BUGS
  1310.          None known.
  1311.      
  1312.         SEE ALSO
  1313.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_BeginWrite()
  1314.  
  1315. NCP_WaitWrite
  1316. -------------
  1317.  
  1318.         NAME
  1319.          NCP_WaitWrite -- complete a write request on the NCP channel.
  1320.      
  1321.         SYNOPSIS
  1322.          result = NCP_WaitWrite( channel )
  1323.            D0                     A0
  1324.      
  1325.          LONG NCP_WaitWrite( APTR );
  1326.      
  1327.         FUNCTION
  1328.          Waits for the current write request to finish and
  1329.          returns the result.
  1330.      
  1331.         INPUTS
  1332.          channel -- a NCP channel created by NCP_OpenChannel()
  1333.      
  1334.         RESULT
  1335.          status -- number of bytes written or a negative error
  1336.                    number.
  1337.      
  1338.         EXAMPLE
  1339.      
  1340.         NOTES
  1341.          Every write request startet with NCP_BeginWrite() absolutely
  1342.          must be followed by a NCP_WaitWrite(), even if it already
  1343.          finished or was aborted via NCP_AbortWrite().
  1344.      
  1345.         BUGS
  1346.          Calling this function without an queued write request
  1347.          will hang up your process.
  1348.      
  1349.         SEE ALSO
  1350.          NCP_Write(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1351.  
  1352. NCP_WriteSig
  1353. ------------
  1354.  
  1355.         NAME
  1356.          NCP_WriteSig -- return signal mask of channel write port.
  1357.      
  1358.         SYNOPSIS
  1359.          sigmask = NCP_WriteSig( channel )
  1360.            D0                     A0
  1361.      
  1362.          ULONG NCP_WriteSig( APTR );
  1363.      
  1364.         FUNCTION
  1365.          This function returns the signal mask of the write port
  1366.          of the given NCP channel. This signal is set if a write
  1367.          request completes.
  1368.      
  1369.         INPUTS
  1370.          channel -- a NCP channel created by NCP_OpenChannel()
  1371.      
  1372.         RESULT
  1373.          sigmask -- signal mask of write port.
  1374.      
  1375.         EXAMPLE
  1376.      
  1377.         NOTES
  1378.          Note that this function returns a signal mask, not a signal bit number.
  1379.      
  1380.         BUGS
  1381.      
  1382.         SEE ALSO
  1383.          NCP_BeginWrite()
  1384.  
  1385. NCP_Fault
  1386. ---------
  1387.  
  1388.         NAME
  1389.          NCP_Fault -- return localized NCP error string
  1390.      
  1391.         SYNOPSIS
  1392.          NCP_Fault( code, header, buffer, buffersize );
  1393.                     D0     A0      A1        D1
  1394.      
  1395.         void NCP_Fault( LONG, STRPTR, STRPTR, ULONG );
  1396.      
  1397.         FUNCTION
  1398.          Returns a localized text string associated with the
  1399.          error code.
  1400.      
  1401.         INPUTS
  1402.          code -- NCP error code
  1403.          header -- header to insert before string. May be NULL
  1404.          buffer -- buffer to write the error text to
  1405.          buffersize -- size of buffer
  1406.      
  1407.         RESULT
  1408.          None.
  1409.      
  1410.         EXAMPLE
  1411.      
  1412.         NOTES
  1413.      
  1414.         BUGS
  1415.          None known.
  1416.      
  1417.         SEE ALSO
  1418.          dos.library/Fault()
  1419.  
  1420. NCP_LinkRemoteRun
  1421. -----------------
  1422.  
  1423.         NAME
  1424.          NCP_LinkRemoteRun -- use the NCP link channel to run a program on
  1425.                               the remote machine.
  1426.      
  1427.         SYNOPSIS
  1428.          error = NCP_LinkRemoteRun( filename, cmdline, cmdlinelen )
  1429.          D0                            A0       A1        D0
  1430.      
  1431.         LONG NCP_LinkRemoteRun( STRPTR, APTR, ULONG );
  1432.      
  1433.         FUNCTION
  1434.          Use the LINK supervisor channel to have the remote link
  1435.          run a program. No NCP channel needs to be opened in order
  1436.          to perform this operation.
  1437.      
  1438.         INPUTS
  1439.          filename -- file name of the remote program to start
  1440.          cmdline -- pointer to command line array. Note that
  1441.                     EPOC command lines are *NOT* zero terminated.
  1442.          cmdlinelen -- length of command line in bytes. May be
  1443.                        zero, in which case no command line
  1444.                        is transfered.
  1445.      
  1446.         RESULT
  1447.          error -- either an AmigaNCP specific error code or the
  1448.                   result code from the remote link.
  1449.      
  1450.         EXAMPLE
  1451.          Have WORD.APP read the Amiga startup sequence:
  1452.      
  1453.             UBYTE cmdline[] = {
  1454.              "OANCPTest\000 V TES\000REM::SYS:\S\STARTUP-SEQUENCE\000"
  1455.             };
  1456.             error = NCP_LinkRemoteRun( "WORD.APP", cmdline, sizeof( cmdline ) );
  1457.      
  1458.         NOTES
  1459.          See the Psion SDK for more information about using commandlines and
  1460.          the LINK process launch feature.
  1461.      
  1462.         BUGS
  1463.          None known.
  1464.      
  1465.         SEE ALSO
  1466.  
  1467. NCP_clnl
  1468. --------
  1469.  
  1470.         NAME
  1471.          NCP_clnl -- clear CR/LF at end of line.
  1472.      
  1473.         SYNOPSIS
  1474.          NCP_clnl( string )
  1475.                    A0
  1476.      
  1477.          void NCP_clnl( STRPTR );
  1478.      
  1479.         FUNCTION
  1480.          Clears any CR or LF characters at the end of the string.
  1481.      
  1482.         INPUTS
  1483.          string -- pointer to string (contents will be modified)
  1484.      
  1485.         RESULT
  1486.          None.
  1487.      
  1488.         EXAMPLE
  1489.      
  1490.         NOTES
  1491.      
  1492.         BUGS
  1493.          None known.
  1494.      
  1495.         SEE ALSO
  1496.  
  1497. NCP_ibm2iso
  1498. -----------
  1499.  
  1500.         NAME
  1501.          NCP_ibm2iso -- convert IBM to ISO charachter
  1502.      
  1503.         SYNOPSIS
  1504.          isochar = NCP_ibm2iso( ibmchar )
  1505.            D0                    D0 0:7
  1506.      
  1507.          UBYTE NCP_ibm2iso( UBYTE );
  1508.      
  1509.         FUNCTION
  1510.          Converts a character from the IBM to the ISO charset.
  1511.      
  1512.         INPUTS
  1513.          ibmchar -- character of the IBM codeset
  1514.      
  1515.         RESULT
  1516.          isochar -- equivalent character in the ISO codeset
  1517.      
  1518.         EXAMPLE
  1519.      
  1520.         NOTES
  1521.      
  1522.         BUGS
  1523.          None known.
  1524.      
  1525.         SEE ALSO
  1526.  
  1527. NCP_tab_ibm2iso
  1528. ---------------
  1529.  
  1530.         NAME
  1531.          NCP_tab_ibm2iso -- returns pointer to internal ibm2iso tab
  1532.      
  1533.         SYNOPSIS
  1534.          tab = NCP_tab_ibm2iso()
  1535.          D0/A0
  1536.      
  1537.          UBYTE *NCP_tab_ibm2iso( void );
  1538.      
  1539.         FUNCTION
  1540.          Returns a pointer to the internal ibm2iso conversion table.
  1541.          This allows you to do more efficient conversion.
  1542.      
  1543.         INPUTS
  1544.          None.
  1545.      
  1546.         RESULT
  1547.          tab -- pointer to 256 byte conversion table.
  1548.      
  1549.         EXAMPLE
  1550.      
  1551.         NOTES
  1552.          The pointer is returned both in D0 and A0.
  1553.      
  1554.         BUGS
  1555.          None known.
  1556.      
  1557.         SEE ALSO
  1558.  
  1559. NCP_tab_iso2ibm
  1560. ---------------
  1561.  
  1562.         NAME
  1563.          NCP_tab_iso2ibm -- returns pointer to internal iso2ibm tab
  1564.      
  1565.         SYNOPSIS
  1566.          tab = NCP_tab_iso2ibm()
  1567.          D0/A0
  1568.      
  1569.          UBYTE *NCP_tab_iso2ibm( void );
  1570.      
  1571.         FUNCTION
  1572.          Returns a pointer to the internal ISO2IBM conversion table.
  1573.          This allows you to do more efficient conversion.
  1574.      
  1575.         INPUTS
  1576.          None.
  1577.      
  1578.         RESULT
  1579.          tab -- pointer to 256 byte conversion table.
  1580.      
  1581.         EXAMPLE
  1582.      
  1583.         NOTES
  1584.          The pointer is returned both in D0 and A0.
  1585.      
  1586.         BUGS
  1587.          None known.
  1588.      
  1589.         SEE ALSO
  1590.  
  1591. NCP_iso2ibm
  1592. -----------
  1593.  
  1594.         NAME
  1595.          NCP_iso2ibm -- convert IBM to ISO charachter
  1596.      
  1597.         SYNOPSIS
  1598.          ibmchar = NCP_iso2ibm( isochar )
  1599.            D0                    D0 0:7
  1600.      
  1601.          UBYTE NCP_iso2ibm( UBYTE );
  1602.      
  1603.         FUNCTION
  1604.          Converts a character from the ISO to the IBM charset.
  1605.      
  1606.         INPUTS
  1607.          isochar -- character of the ISO codeset
  1608.      
  1609.         RESULT
  1610.          ibmchar -- equivalent character in the IBM codeset
  1611.      
  1612.         EXAMPLE
  1613.      
  1614.         NOTES
  1615.      
  1616.         BUGS
  1617.          None known.
  1618.      
  1619.         SEE ALSO
  1620.  
  1621. NCP_IWORD
  1622. ---------
  1623.  
  1624.         NAME
  1625.          NCP_IWORD -- swap bytes in word
  1626.      
  1627.         SYNOPSIS
  1628.          sword = NCP_IWORD( word )
  1629.            D0                D0
  1630.      
  1631.          UWORD NCP_IWORD( UWORD );
  1632.      
  1633.         FUNCTION
  1634.          Swaps the byte order within the word.
  1635.      
  1636.         INPUTS
  1637.          word -- a 16 bit data word.
  1638.      
  1639.         RESULT
  1640.          sword -- the same word with the byte order swapped.
  1641.      
  1642.         EXAMPLE
  1643.      
  1644.         NOTES
  1645.      
  1646.         BUGS
  1647.          None known.
  1648.      
  1649.         SEE ALSO
  1650.  
  1651. NCP_IWORDP
  1652. ----------
  1653.  
  1654.         NAME
  1655.          NCP_IWORDP -- swap bytes in word (pointer version)
  1656.      
  1657.         SYNOPSIS
  1658.          sword = NCP_IWORDP( wordp1, wordp2 )
  1659.            D0                  A0      A1
  1660.      
  1661.          UWORD NCP_IWORDP( UWORD *, UWORD * );
  1662.      
  1663.         FUNCTION
  1664.          Swaps the byte order from the word pointed to by wordp1
  1665.          and places the result in the word pointed to by wordp2.
  1666.      
  1667.         INPUTS
  1668.          wordp1 -- pointer to source word
  1669.          wordp2 -- pointer to destination word
  1670.      
  1671.         RESULT
  1672.          sword -- the same word with the byte order swapped.
  1673.      
  1674.         EXAMPLE
  1675.      
  1676.         NOTES
  1677.          The words don't need to be word aligned.
  1678.      
  1679.         BUGS
  1680.          The 68020++ version of amigancp.library requires the hardware
  1681.          to be able to do misaligned word accesses. Some early
  1682.          accelerator boards may have problems doing this.
  1683.      
  1684.         SEE ALSO
  1685.  
  1686. NCP_IWORDPI
  1687. -----------
  1688.  
  1689.         NAME
  1690.          NCP_IWORDPI -- swap bytes in word (in-place pointer version)
  1691.      
  1692.         SYNOPSIS
  1693.          sword = NCP_IWORDPI( wordp1 )
  1694.            D0                   A0
  1695.      
  1696.          UWORD NCP_IWORDP( UWORD * )
  1697.      
  1698.         FUNCTION
  1699.          Swaps the byte order within the word pointed to by wordp.
  1700.      
  1701.         INPUTS
  1702.          wordp -- pointer to word to swap
  1703.      
  1704.         RESULT
  1705.          sword -- the same word with the byte order swapped.
  1706.      
  1707.         EXAMPLE
  1708.      
  1709.         NOTES
  1710.          The word doesn't need to be word aligned.
  1711.      
  1712.         BUGS
  1713.          The 68020++ version of amigancp.library requires the hardware
  1714.          to be able to do misaligned word accesses. Some early
  1715.          accelerator boards may have problems doing this.
  1716.      
  1717.         SEE ALSO
  1718.  
  1719. NCP_ILONG
  1720. ---------
  1721.  
  1722.         NAME
  1723.          NCP_ILONG -- swap bytes in longword
  1724.      
  1725.         SYNOPSIS
  1726.          slongword = NCP_ILONG( longword )
  1727.            D0                     D0
  1728.      
  1729.          ULONG NCP_ILONG( ULONG );
  1730.      
  1731.         FUNCTION
  1732.          Swaps the byte order within the longword.
  1733.      
  1734.         INPUTS
  1735.          longword -- a 32 bit data word.
  1736.      
  1737.         RESULT
  1738.          slongword -- the same word with the byte order swapped.
  1739.      
  1740.         EXAMPLE
  1741.      
  1742.         NOTES
  1743.      
  1744.         BUGS
  1745.          None known.
  1746.      
  1747.         SEE ALSO
  1748.  
  1749. NCP_ILONGP
  1750. ----------
  1751.  
  1752.         NAME
  1753.          NCP_ILONGP -- swap bytes in longword (pointer version)
  1754.      
  1755.         SYNOPSIS
  1756.          sword = NCP_ILONGP( longwordp1, longwordp2 )
  1757.            D0                    A0          A1
  1758.      
  1759.          ULONG NCP_ILONGP( ULONG *, ULONG * );
  1760.      
  1761.         FUNCTION
  1762.          Swaps the byte order from the longword pointed to by longwordp1
  1763.          and places the result in the longword pointed to by longwordp2.
  1764.      
  1765.         INPUTS
  1766.          longwordp1 -- pointer to source longword
  1767.          longwordp2 -- pointer to destination longword
  1768.      
  1769.         RESULT
  1770.          sword -- the same word with the byte order swapped.
  1771.      
  1772.         EXAMPLE
  1773.      
  1774.         NOTES
  1775.          The longwords don't need to be word aligned.
  1776.      
  1777.         BUGS
  1778.          The 68020++ version of amigancp.library requires the hardware
  1779.          to be able to do misaligned word accesses. Some early
  1780.          accelerator boards may have problems doing this.
  1781.      
  1782.         SEE ALSO
  1783.  
  1784. NCP_ILONGPI
  1785. -----------
  1786.  
  1787.         NAME
  1788.          NCP_ILONGPI -- swap bytes in longword (in-place pointer version)
  1789.      
  1790.         SYNOPSIS
  1791.          sword = NCP_ILONGPI( longwordp )
  1792.            D0                    A0
  1793.      
  1794.          ULONG NCP_ILONGP( ULONG * )
  1795.      
  1796.         FUNCTION
  1797.          Swaps the byte order within the longword pointed to by longwordp.
  1798.      
  1799.         INPUTS
  1800.          longwordp -- pointer to longword to swap
  1801.      
  1802.         RESULT
  1803.          sword -- the same word with the byte order swapped.
  1804.      
  1805.         EXAMPLE
  1806.      
  1807.         NOTES
  1808.          The longword doesn't need to be word aligned.
  1809.      
  1810.         BUGS
  1811.          The 68020++ version of amigancp.library requires the hardware
  1812.          to be able to do misaligned word accesses. Some early
  1813.          accelerator boards may have problems doing this.
  1814.      
  1815.         SEE ALSO
  1816.  
  1817. Error codes from NCP functions
  1818. ==============================
  1819.  
  1820. Several amigancp.library functions may return negative error
  1821. numbers.  Note that besides the errors internal to
  1822. amigancp.library, standard EPOC OS errors may be returned by some
  1823. functions.
  1824.  
  1825. NCPE_INUSE (-1)
  1826.      There is already a read/write request pending on the given channel.
  1827.  
  1828. NCPE_ABORTED (-2)
  1829.      The read/write request has been aborted by NCP_AbortXXX()
  1830.  
  1831. NCPE_OFFLINE (-3)
  1832.      There is no NCP connection.  This may denote that the remote NCP
  1833.      closed the connection.
  1834.  
  1835. NCPE_INACTIVE (-4)
  1836.      The channel is currently inactive.  Most likely it has been closed
  1837.      by the remote process, or the NCP connection is currently dropped
  1838.      due to serial link failure.
  1839.  
  1840. NCPE_NOTFOUND (-5)
  1841.      You attempted to open an active channel and the remote process
  1842.      didn't exist.
  1843.  
  1844. NCPE_RECONNECTED (-6)
  1845.      This is not really an error.  Queued read requests will be
  1846.      terminated with this error value if the NCP connection has been
  1847.      succesfully reconnected.
  1848.  
  1849. NCPE_NEWUSER (-7)
  1850.      This is not really an error.  It may come up if the remote client
  1851.      of a passive channel changed.
  1852.  
  1853. Index
  1854. *****
  1855.  
  1856.  
  1857.  
  1858.  AmigaNCP.config                        Using AmigaNCP
  1859.  AmigaNCP File Server                   File Server
  1860.  AmigaNCP File System                   File System
  1861.  AmigaNCP-PrintServer                   AmigaNCP-PrintServer
  1862.  amigancp.library calls                 API
  1863.  amigancp.library functions             API
  1864.  API                                    API
  1865.  error codes                            Errors
  1866.  File Server options                    File Server
  1867.  File System Options                    File System
  1868.  function calls                         API
  1869.  Installation                           Using AmigaNCP
  1870.  Installing AmigaNCP                    Using AmigaNCP
  1871.  Introduction                           Introduction
  1872.  Monitor                                AmigaNCP-Monitor
  1873.  NCP errors                             Errors
  1874.  NCP-Monitor                            AmigaNCP-Monitor
  1875.  NCP_AbortRead                          NCP_AbortRead
  1876.  NCP_AbortWrite                         NCP_AbortWrite
  1877.  NCP_BeginRead                          NCP_BeginRead
  1878.  NCP_BeginWrite                         NCP_BeginWrite
  1879.  NCP_CheckRead                          NCP_CheckRead
  1880.  NCP_CheckWrite                         NCP_CheckWrite
  1881.  NCP_clnl                               NCP_clnl
  1882.  NCP_CloseChannel                       NCP_CloseChannel
  1883.  NCP_Fault                              NCP_Fault
  1884.  NCP_ibm2iso                            NCP_ibm2iso
  1885.  NCP_ILONG                              NCP_ILONG
  1886.  NCP_ILONGP                             NCP_ILONGP
  1887.  NCP_ILONGPI                            NCP_ILONGPI
  1888.  NCP_iso2ibm                            NCP_iso2ibm
  1889.  NCP_IWORD                              NCP_IWORD
  1890.  NCP_IWORDP                             NCP_IWORDP
  1891.  NCP_IWORDPI                            NCP_IWORDPI
  1892.  NCP_LinkRemoteRun                      NCP_LinkRemoteRun
  1893.  NCP_OpenChannel                        NCP_OpenChannel
  1894.  NCP_Read                               NCP_Read
  1895.  NCP_ReadSig                            NCP_ReadSig
  1896.  NCP_tab_ibm2iso                        NCP_tab_ibm2iso
  1897.  NCP_tab_iso2ibm                        NCP_tab_iso2ibm
  1898.  NCP_WaitRead                           NCP_WaitRead
  1899.  NCP_WaitWrite                          NCP_WaitWrite
  1900.  NCP_Write                              NCP_Write
  1901.  NCP_WriteSig                           NCP_WriteSig
  1902.  Network Monitor                        AmigaNCP-Monitor
  1903.  Options, File Server                   File Server
  1904.  Options, File System                   File System
  1905.  Other Tools                            Other Tools
  1906.  Parts                                  Introduction
  1907.  Remote File Server                     File Server
  1908.  Remote File System                     File System
  1909.  S3Run                                  S3Run
  1910.  serial configuration                   Using AmigaNCP
  1911.  serial.device, configuration of        Using AmigaNCP
  1912.  
  1913.